'use strict';
const db = uniCloud.database();
exports.main = async (event, context) => {
  
  let { email } = event;
  let chackEmailResult = await db.collection('users').where({
	  email
  }).get()
  
  if(chackEmailResult.affectedDocs !== 0 || chackEmailResult.data.length !== 0){
	  return {
		  status:0,
		  msg:"验证成功，用户存在"
	  }
  } else {
	return {
		status:1,
		msg:"查无此人"
	}  
  }
  
  return {
	  status:-1,
	  msg:"稍后重试"
  }
};
